package com.colin.aiyi.view;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.widget.Toast;

import com.colin.aiyi.R;
import com.colin.aiyi.app.MyApp;
import me.shaohui.shareutil.WXUtil;



public class ShareBottomDialog extends BaseBottomDialog implements View.OnClickListener {
    Bitmap bitmap;//= BitmapFactory.decodeResource(getResources(),R.mipmap.app_logo);
    String url;
    String title;
    String des;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public Bitmap getBitmap() {
        return bitmap;
    }

    public void setBitmap(Bitmap bitmap) {
        this.bitmap = bitmap;
    }

    @Override
    public int getLayoutRes() {
        return R.layout.layout_bottom_share;
    }

    @Override
    public void bindView(final View v) {
        v.findViewById(R.id.share_qq).setOnClickListener(this);
        v.findViewById(R.id.share_qzone).setOnClickListener(this);
        v.findViewById(R.id.share_weibo).setOnClickListener(this);
        v.findViewById(R.id.share_wx).setOnClickListener(this);
        v.findViewById(R.id.share_wx_timeline).setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.share_qq:
             /*   MyShareUtil.shareImage(getContext(), SharePlatform.QQ,
                        "http://shaohui.me/images/avatar.gif", mShareListener);*/
                break;
            case R.id.share_qzone:
             /*   MyShareUtil.shareMedia(getContext(), SharePlatform.QZONE, "Title", "summary",
                        "http://www.google.com", "http://shaohui.me/images/avatar.gif",
                        mShareListener);*/
                break;
            case R.id.share_weibo:
            /*    MyShareUtil.shareImage(getContext(), SharePlatform.WEIBO,
                        "http://shaohui.me/images/avatar.gif", mShareListener);*/
                break;
            case R.id.share_wx_timeline:
               /* MyShareUtil.shareText(getContext(), SharePlatform.WX_TIMELINE, "测试分享文字",
                        mShareListener);*/
              WXUtil.sendReqToWXQ(url,title,des,bitmap);

                break;
            case R.id.share_wx:
               WXUtil.sendReqToWX(url,title,des,bitmap);


                break;
        }
        dismiss();
    }
}
